From ef18f55740fb65e23c8ed79d69095da25f7423cc Mon Sep 17 00:00:00 2001 From: parkrrrr Date: Thu, 26 Jul 2007 01:14:13 +0000 Subject: [PATCH] route simplifier crashed if simplifying by error on routes that couldn't be simplified (<= 2 points) --- smplrout.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/smplrout.c b/smplrout.c index ec370aaa6..a7bdd2edb 100644 --- a/smplrout.c +++ b/smplrout.c @@ -195,6 +195,9 @@ routesimple_head( const route_head *rte ) /* short-circuit if we already have fewer than the max points */ if ( countopt && count >= rte->rte_waypt_ct) return; + /* short-circuit if the route is impossible to simplify, too. */ + if ( 2 >= rte->rte_waypt_ct ) return; + xte_recs = (struct xte *) xcalloc( rte->rte_waypt_ct, sizeof (struct xte)); cur_rte = rte; -- 2.30.2